package com.guigu.www.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.www.mapper.MManufactureMapper;
import com.guigu.www.pojo.MManufacture;
import com.guigu.www.service.MManufactureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MManufactureServiceImpl extends ServiceImpl<MManufactureMapper,MManufacture>
        implements MManufactureService {

    //创建mapper
    @Autowired
    MManufactureMapper mManufactureMapper;;
    @Override
    public IPage<MManufacture> queryByproducktionsregistrierung(int pageno, int pagesize) {
        //创建papge
        Page page=new Page(pageno,pagesize);

        //获取设置条件
        QueryWrapper<MManufacture> queryWrappe=new QueryWrapper<MManufacture>();
        queryWrappe.eq("CHECK_TAG","S001-1");
        queryWrappe.notIn("MANUFACTURE_PROCEDURE_TAG","S002-2");
        return this.page(page,queryWrappe);
    }

    @Override
    public MManufacture queryByMmanufacturebymanufactureId(String manufactureId) {
        return mManufactureMapper.queryByMmanufacturebymanufactureId(manufactureId);
    }

    @Override
    public IPage<MManufacture> queryByMManufacturetag(int pageno, int pagesize) {
        //创建page
        Page page=new Page(pageno,pagesize);
        //获取设置条件
        QueryWrapper<MManufacture> queryWrapper=new QueryWrapper<MManufacture>();
        queryWrapper.eq("MANUFACTURE_PROCEDURE_TAG","S002-1");
        return this.page(page,queryWrapper);
    }

    @Override
    public IPage<MManufacture> queryBymmanfactureAll(int pageno, int pagesize) {
        //创建page
        Page page=new Page(pageno,pagesize);
        //创建设置条件
        QueryWrapper<MManufacture> queryWrapper=new QueryWrapper<MManufacture>();
        return this.page(page,queryWrapper);
    }
}
